8 unsigned int g
[MAXN
][MAXN
];
13 for (int C
=1; C
<= T
; C
++){
17 for (int i
=0; i
<n
; ++i
){
18 for (int j
=0; j
<n
; ++j
){
29 g
[i
][j
] = g
[j
][i
] = 1;
34 for (int k
=0; k
<n
; ++k
){
35 for (int i
=0; i
<n
; ++i
){
36 for (int j
=0; j
<n
; ++j
){
37 g
[i
][j
] = min(g
[i
][j
], g
[i
][k
] + g
[k
][j
]);
42 unsigned int answer
= 0;
43 for (int i
=0; i
<n
; ++i
){
44 answer
= max(answer
, g
[start
][i
] + g
[i
][end
]);
47 cout
<< "Case " << C
<< ": " << answer
<< endl
;